|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPER.rover.control.RoverController
PER.rover.Rover
High-level control of the Rover.
Field Summary | |
static java.lang.String |
defaultIP
Default IP address |
static java.lang.String |
topLevelDir
Directory for saved files, logs etc. |
static boolean |
USING_MARS_ROVER
Tells my code whether we are using the mars rover or the prototype |
Fields inherited from class PER.rover.control.RoverController |
highLevelState, READ_TIMEOUT, receive, reliagram, state |
Constructor Summary | |
Rover()
Creates a new Rover |
Method Summary | |
java.util.Timer |
executeFunctionAtTime(java.util.TimerTask task,
java.util.Date time)
Schedules the specified task for execution at the specified time. |
java.util.Timer |
executeFunctionDelay(java.util.TimerTask task,
long delay)
Schedules the specified task for execution after the specified delay. |
java.util.Timer |
executeFunctionTimerAtTime(java.util.TimerTask task,
java.util.Date firstTime,
long period,
boolean fixedRate)
Schedules the specified task for repeated fixed-delay execution, beginning at the specified time. |
java.util.Timer |
executeFunctionTimerDelay(java.util.TimerTask task,
long delay,
long period,
boolean fixedRate)
Schedules the specified task for repeated fixed-delay execution, beginning after the specified delay. |
java.lang.String |
getCurrentIP()
Returns the IP address currently being used. |
static java.lang.String |
getDefaultIP()
Loads the last used IP address from a saved file. |
long |
getTime()
Returns the current system time in milliseconds. |
static java.lang.String |
getTopLevelDir()
Returns a String that is the path for top level directory. |
boolean |
saveImageToDisk(java.io.File f,
java.awt.image.BufferedImage picture)
Saves a given BufferedImage to a file as a jpg. |
boolean |
saveImageToDisk(java.lang.String filename,
java.awt.image.BufferedImage picture)
Saves a given BufferedImage to disk as a jpg at filename . |
static void |
saveIP(java.lang.String IP)
Saves the given IP address to a file so that it can be loaded the next time the program is executed. |
void |
setCurrentIP(java.lang.String ip)
Sets the current IP address being used. |
static void |
setTopLevelDir(java.lang.String s)
Sets the top level directory and makes sure the new directory exists. |
boolean |
sleep(long duration)
Sleeps for duration milliseconds. |
void |
stopExecuteFunction(java.util.Timer timer)
Finishes executing a timer function. |
java.util.TimerTask |
timeLapse(int pan,
int tilt,
int width,
int height,
boolean UV,
javax.swing.JLabel displayLabel)
Returns a TimerTask that takes pictures and displays them to a specified JLabel. |
java.util.TimerTask |
timeLapse(int pan,
int tilt,
int width,
int height,
boolean UV,
java.lang.String pathPrefix)
Returns a TimerTask that takes pictures and saves them. |
java.util.TimerTask |
timeLapse(int pan,
int tilt,
int width,
int height,
boolean UV,
java.lang.String pathPrefix,
javax.swing.JLabel displayLabel)
Returns a TimerTask that takes pictures, saves them to file, and displays them to a specified JLabel. |
Methods inherited from class PER.rover.control.RoverController |
closeComm, compareVersion, crab, getCalibration, getCameraProperties, getDriveCalibration, getMean, getScanList, getTurnCalibration, getVersion, goTo, goTo, headMove, initComm, initRobot, isConnected, killHighLevel, killRobot, look, quadTurn, refresh, scan, setAll, setCalibration, setLight, setPan, setScanList, setTilt, spin, startMotionDetection, startTrack, startTrack, stopStreaming, takePicture, takePicture, takeRawPicture, takeRecentPicture, turnTo, turnTo, updateHighLevel |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final boolean USING_MARS_ROVER
public static java.lang.String topLevelDir
public static java.lang.String defaultIP
Constructor Detail |
public Rover()
Method Detail |
public static void setTopLevelDir(java.lang.String s)
public static java.lang.String getTopLevelDir()
public java.lang.String getCurrentIP()
public void setCurrentIP(java.lang.String ip)
public static java.lang.String getDefaultIP()
defaultIP
.
defaultIP
public static void saveIP(java.lang.String IP)
getDefaultIP()
public long getTime()
public boolean saveImageToDisk(java.lang.String filename, java.awt.image.BufferedImage picture)
filename
.
The filename
string should be a complete path, for example:
"c:/PERFilesystem/SavedRoverFiles/name.jpg"
Rover.getTopLevelDir()+"/name.jpg"
filename
- Path at which to save the imagepicture
- Image to save
public boolean saveImageToDisk(java.io.File f, java.awt.image.BufferedImage picture)
f
- The file where the image should be savedpicture
- Image to save
public boolean sleep(long duration)
duration
milliseconds.
duration
- Time to sleep, in milliseconds.
public java.util.Timer executeFunctionAtTime(java.util.TimerTask task, java.util.Date time)
task
- TimerTask function to executetime
- Time at which to execute the function
TimerTask
,
Timer
,
Date
public java.util.Timer executeFunctionTimerAtTime(java.util.TimerTask task, java.util.Date firstTime, long period, boolean fixedRate)
task
- TimerTask function to executefirstTime
- The time to begin executionperiod
- Rate at which to execute the function, in milliseconds.fixedRate
- True if task should be executed relative to the initial start time,
false if it should be executed relative to when the last task ended.
TimerTask
,
Timer
,
Date
public java.util.Timer executeFunctionDelay(java.util.TimerTask task, long delay)
task
- TimerTask function to executedelay
- Time to wait before executing the function, in milliseconds.
TimerTask
,
Timer
public java.util.Timer executeFunctionTimerDelay(java.util.TimerTask task, long delay, long period, boolean fixedRate)
task
- TimerTask function to executedelay
- Time to wait before executing the function, in milliseconds.period
- Rate at which to execute the function, in milliseconds.fixedRate
- True if task should be executed relative to the initial start time,
false if it should be executed relative to when the last task ended.
TimerTask
,
Timer
public void stopExecuteFunction(java.util.Timer timer)
timer
- The timer to kill.Timer
public java.util.TimerTask timeLapse(int pan, int tilt, int width, int height, boolean UV, java.lang.String pathPrefix)
pan
- The pan value in degrees at which to take the picturetilt
- The tilt vale in degrees at which to take the picturewidth
- The width of the image in pixelsheight
- The height of the image in pixelsUV
- True if the UV light should be on for the picture, false otherwisepathPrefix
- The path where time-lapse pictures should be saved. They
will get a suffix of a sequence number plus ".jpg"
TimerTask
,
executeFunctionTimerAtTime(java.util.TimerTask, java.util.Date, long, boolean)
,
executeFunctionTimerDelay(java.util.TimerTask, long, long, boolean)
public java.util.TimerTask timeLapse(int pan, int tilt, int width, int height, boolean UV, javax.swing.JLabel displayLabel)
pan
- The pan value in degrees at which to take the picturetilt
- The tilt vale in degrees at which to take the picturewidth
- The width of the image in pixelsheight
- The height of the image in pixelsUV
- True if the UV light should be on for the picture, false otherwisedisplayLabel
- An optional JLabel to display the images to as they
are taken.
TimerTask
,
executeFunctionTimerAtTime(java.util.TimerTask, java.util.Date, long, boolean)
,
executeFunctionTimerDelay(java.util.TimerTask, long, long, boolean)
public java.util.TimerTask timeLapse(int pan, int tilt, int width, int height, boolean UV, java.lang.String pathPrefix, javax.swing.JLabel displayLabel)
pan
- The pan value in degrees at which to take the picturetilt
- The tilt vale in degrees at which to take the picturewidth
- The width of the image in pixelsheight
- The height of the image in pixelsUV
- True if the UV light should be on for the picture, false otherwisepathPrefix
- An optional path where time-lapse pictures should be saved.
If pathPrefix
is null
, pictures will not be saved.
If pathPrefix
is not null
, pictures will be saved
with a suffix of a sequence number plus ".jpg"displayLabel
- An optional JLabel to display the images to as they
are taken. displayLabel
can be null if images are not
to be displayed.
TimerTask
,
executeFunctionTimerAtTime(java.util.TimerTask, java.util.Date, long, boolean)
,
executeFunctionTimerDelay(java.util.TimerTask, long, long, boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |